package com.codebattery.domain.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;

@Entity
public class Node {
    private int id;
    private String node;
    private String title;
    private Byte isMenu;
    private Byte isAuth;
    private Byte isLogin;
    private String createAt;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "node")
    public String getNode() {
        return node;
    }

    public void setNode(String node) {
        this.node = node;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "is_menu")
    public Byte getIsMenu() {
        return isMenu;
    }

    public void setIsMenu(Byte isMenu) {
        this.isMenu = isMenu;
    }

    @Basic
    @Column(name = "is_auth")
    public Byte getIsAuth() {
        return isAuth;
    }

    public void setIsAuth(Byte isAuth) {
        this.isAuth = isAuth;
    }

    @Basic
    @Column(name = "is_login")
    public Byte getIsLogin() {
        return isLogin;
    }

    public void setIsLogin(Byte isLogin) {
        this.isLogin = isLogin;
    }

    @Basic
    @Column(name = "create_at")
    public String getCreateAt() {
        return createAt;
    }

    public void setCreateAt(String createAt) {
        this.createAt = createAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Node node1 = (Node) o;
        return id == node1.id &&
                Objects.equals(node, node1.node) &&
                Objects.equals(title, node1.title) &&
                Objects.equals(isMenu, node1.isMenu) &&
                Objects.equals(isAuth, node1.isAuth) &&
                Objects.equals(isLogin, node1.isLogin) &&
                Objects.equals(createAt, node1.createAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, node, title, isMenu, isAuth, isLogin, createAt);
    }
}
